package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.BladeConsumeMapper;
import com.ruoyi.consume.domain.BladeConsume;
import com.ruoyi.consume.service.IBladeConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class BladeConsumeServiceImpl implements IBladeConsumeService
{
    @Autowired
    private BladeConsumeMapper bladeConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param bladeConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public BladeConsume selectBladeConsumeById(Long bladeConsumeId)
    {
        return bladeConsumeMapper.selectBladeConsumeById(bladeConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param bladeConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<BladeConsume> selectBladeConsumeList(BladeConsume bladeConsume)
    {
        return bladeConsumeMapper.selectBladeConsumeList(bladeConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param bladeConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertBladeConsume(BladeConsume bladeConsume)
    {
        bladeConsume.setCreateTime(DateUtils.getNowDate());
        return bladeConsumeMapper.insertBladeConsume(bladeConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param bladeConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updateBladeConsume(BladeConsume bladeConsume)
    {
        bladeConsume.setUpdateTime(DateUtils.getNowDate());
        return bladeConsumeMapper.updateBladeConsume(bladeConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param bladeConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteBladeConsumeByIds(Long[] bladeConsumeIds)
    {
        return bladeConsumeMapper.deleteBladeConsumeByIds(bladeConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param bladeConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteBladeConsumeById(Long bladeConsumeId)
    {
        return bladeConsumeMapper.deleteBladeConsumeById(bladeConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<BladeConsume> getUserName(){
        return bladeConsumeMapper.getUserName();
    }
}
